HOST		:= \
	$(shell \
		sh ./config.guess | \
	 	sed 's/sparc-sun-solaris2.[0-9.]*$$/sun4-solaris2/' | \
		sed 's/sparc-sun-sunos4.1.4/sun4-sunos4/' | \
		sed 's/hppa1.1-hp-hpux\([0-9]*\)\.[0-9]*/parisc-hpux\1/' | \
		sed 's/i[3-6]86-pc-linux-gnu*/x86-linux2/' | \
		sed 's/hppa2.0-hp-hpux\([0-9]*\)\.[0-9]*/parisc-hpux\1/' | \
		sed 's/i[0-9]*-pc-cygwin.*/x86-win32/' \
	)

ifeq ($(HOST),x86-win32)
vc:=$(shell pwd | sed 's,/\([a-zA-Z]\)/,\1:/,; s,/river/.*$$,/river,' )
wb:=$(vc)
vc:=$(vc)/devtools/msvc/vc/bin
default arm thumb i960 m68k sparc powerpc sh i386 pentium mips native:
	MAKEFLAGS= WIND_BASE=$(wb) $(vc)/nmake -f Makefile.w32 TARGET_ARCH=$@ >> "$(HOST).$@.log" 2>&1
else
default arm thumb i960 m68k sparc powerpc simso sh i386 pentium mips hppa native:
	make -f makefile $@ >> "$(HOST).$@.log" 2>&1
endif
